package org.edu.modules.research.rwork.service.impl;

import org.edu.common.base.BasePageDto;
import org.edu.common.base.BaseServiceImpl;
import org.edu.common.utils.ConvertUtils;
import org.edu.common.base.BaseServiceImpl;
import org.edu.modules.research.rwork.mapper.VeJkyMeetRemindUserMapper;
import org.edu.modules.research.rwork.entity.VeJkyMeetRemindUser;
import org.edu.modules.research.rwork.dto.VeJkyMeetRemindUserDto;
import org.edu.modules.research.rwork.service.VeJkyMeetRemindUserService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;


/**
 * 实现类
 */
@Service
public class VeJkyMeetRemindUserServiceImpl extends BaseServiceImpl<VeJkyMeetRemindUser, VeJkyMeetRemindUserMapper> implements VeJkyMeetRemindUserService {

    @Override
    public void deleteByPid(String pid) {
        mapper.deleteByPid(pid);
    }

    public IPage<VeJkyMeetRemindUserDto> pageDto(BasePageDto page, @Param(Constants.WRAPPER) Wrapper queryWrapper){
        return mapper.pageDto(page,queryWrapper);
    }
    /**
    * 查询实体类
    */
    public VeJkyMeetRemindUserDto findDtoById(String id) {
        VeJkyMeetRemindUser entity = super.findById(id);
        VeJkyMeetRemindUserDto dto = ConvertUtils.convertToDto(entity, VeJkyMeetRemindUserDto.class);
        return dto;
    }

    /**
    * 新增或者修改
    */
    public void insertOrUpdate(VeJkyMeetRemindUserDto dto,Boolean isAdd){
        if(isAdd){
            super.insert(dto);
        }else{
            super.update(dto);
        }
    }

}
